/**
 * Created by Administrator on 2016/4/24.
 */
function Minion(name, cost, attack, life, ability) {
    if(this instanceof Minion) {
        this.name = name;
        this.cost = cost;
        this.attack = attack;
        this.life = life;
        this.ability = ability;
    } else {
        return new Minion(name, cost, attack, life, ability);
    }
}

// AngularJS初始化
(function () {
    var app = angular.module("tab", []);

    var minions = [];
    minions.push(new Minion("末日预言者",2,0,7,"在你的回合开始时，消灭场上所有随从"));
    minions.push(new Minion("森金持盾卫士",4,3,5,"嘲讽"));
    minions.push(new Minion("工程师学徒",2,1,1,"战吼：抽一张牌"));

    app.controller("deck",function () {
        this.minions = minions;
    })

    app.controller("tabController", function () {
        this.tab = 0;
        this.setTab = function(tab) {
          this.tab = tab;
        };
        this.isSet = function(tab) {
            return this.tab === tab;
        }
    })
})();